package com.yjd.pub.tag.dao.impl;

import com.yjd.comm.base.dao.impl.BaseDaoImpl;
import com.yjd.comm.tag.model.TagInfoDto;
import com.yjd.comm.tag.model.TagModel;
import com.yjd.pub.tag.dao.ITagDao;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * <b>description</b>：标签数据访问层 <br>
 * <b>time</b>：2017-06-27 08:58:17 <br>
 * <b>author</b>： yangchangyan@yijiedai.com
 */
@Component("tagDao")
public class TagDaoImpl extends BaseDaoImpl implements ITagDao {

	private static final String SQLMAPNAMESPACE = TagModel.class.getName();
	private static final String PKNAME = "tag_id";

	@Override
	public String getPrimaryKeyName() {
		return PKNAME;
	}

	@Override
	public String getSqlmapNamespace() {
		return SQLMAPNAMESPACE;
	}

	/**
	 * 查询某个对象的标签名称
	 *
	 * @param param
	 * @return
	 * @throws Exception
	 */
	@Override
	public List<TagInfoDto> getTagNameList(Map<String, Object> param) throws Exception {
	  return (List<TagInfoDto>) this.getSqlMap(false).queryForList(getStatement("getTagNameList"), param);
	}
}
